﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
using Crossroad.Core.Helper;
using Crossroad.Core.Models;
using Crossroad.System.Common.Model;

namespace Crossroad.System.Common.Service
{
	/// <summary>
    /// 通用附件
    /// </summary>
    public interface IAttachmentService: IRelevantData<Attachment>
    {

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="method"></param>
        /// <param name="loadRelevantData">是否加载关联数据</param>
        Pagination<Attachment> GetPaging(
            int pageIndex,
            int pageSize,
            Action<ISugarQueryable<Attachment>> method,
			bool loadRelevantData = true
        );

        /// <summary>
        /// 查询列表
        /// </summary>
        /// <param name="method"></param>
        /// <param name="loadRelevantData">是否加载关联数据</param>
        /// <returns></returns>
        List<Attachment> GetList(
            Action<ISugarQueryable<Attachment>> method,
			bool loadRelevantData = true
        );

        /// <summary>
        /// 查询详情
        /// </summary>
        /// <param name="method"></param>
        /// <param name="loadRelevantData">是否加载关联数据</param>
        /// <returns></returns>
        Attachment GetEntity(
            Action<ISugarQueryable<Attachment>> method,
			bool loadRelevantData = true
        );

        /// <summary>
        /// 查询详情
        /// </summary>
        /// <param name="id"></param>
        /// <param name="loadRelevantData">是否加载关联数据</param>
        /// <returns></returns>
        Attachment GetEntity(long id, bool loadRelevantData = true);

        /// <summary>
        /// 根据id列表查询maps
        /// </summary>
        /// <param name="idList"></param>
        /// <returns></returns>
        Dictionary<long, Attachment> GetMaps(List<long> idList);

        /// <summary>
        /// 新增返回详情
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Attachment CreateAt(Attachment model);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        Attachment UpdateAt(Attachment model);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="source"></param>
        void DeleteAt(Attachment source);


    }
}

